<cfset BASE = CreateObject("component", "#session.rootDir#.cfc.base") />
<cfset baseQueries = CreateObject("component", "#session.rootDir#.cfc.queries") />
<cfset statusQueries = CreateObject("component", "#session.rootDir#.cfc.statusQueries") />

<cfoutput>
    
<!---HTML header, css links, js links, and page title--->
#BASE.htmlHeaderNonSCF(
    "/jquery/ui-1.8.5/jquery-ui.min.js,/jquery/plugins/scrollTo/jquery.scrollTo-1.4.2-min.js, ../js/Step5-AccessControlUpdate.js", <!---JS links--->
    "/jquery/ui-1.8.5/themes/cupertino/jquery-ui.css", <!---CSS links--->
    "Step 5:  Facilities - Access Control Update", <!---Page Title--->
    "Status", <!---Active Nav Link--->
    "true" <!---Alternate menu.  Shows main EPAR links--->
)#<!---HTML header, css links, js links, and page title--->

<cfif Session.Auth EQ True and (Session.strAuthType EQ Session.IT or Session.strAuthType EQ Session.HR or Session.strAuthType EQ Session.FACILITIES)>   
	    
    <cfset QUERIES.GetStep5Waiting = statusQueries.funcGetNONSCFStepWaiting(7)/>

    <h1 class="title">Step 5:  Facilities - Access Control Update</h1>
	<div class="entry">
		Welcome, #Session.arrEmpInfo.FirstName# #Session.EmpInfo.LastName#.  
		In this step, provide the Access Control IDs as determined when 
		they are added to Access Control.  
        <BR /><BR />
	    
    <cfif QUERIES.GetStep5Waiting.recordcount GT 0>

        <cfform name="frmStep5" method="post" action="api.cfm?api=step5_access_control_update_nonscf">
            <table width = 100%>
				<tr>
					<td colspan="10">
				        <span class="tableHeader">
                            Access Control Creation Report
                        </span>   
				    </td>
					<td align="right" nowrap="nowrap">
				        <a href="PrintAccessControlReport.cfm" target="_blank">
                            Print Report
                        </a>   
				    </td>
				</tr>
				<tr>
				    <td width =25%>&nbsp;</td> 
				    <td><u>##</u></td> 
				    <td width=5%>&nbsp;</td> 
				    <td valign="bottom">
				    	<strong><u>Name, Job Title, &amp; Department (Badge)</u></strong>
				    </td>
				    <td width =5%>&nbsp;</td> 
				    <td valign="bottom" nowrap="nowrap">
				    	<strong><u>Access Level(s) Requested</u></strong>
				    </td>
				    <td width =5%>&nbsp;</td> 
				    <td valign="bottom" nowrap="nowrap">
				    	<strong><u>New Access<BR />Control ID</u></strong>
				    </td>
				    <td width =5%>&nbsp;</td> 
				    <td valign="bottom">
				    	<strong><u>Comments</u></strong>
				    </td>
				    <td width =35%>&nbsp;</td>  
				</tr>
	             
				<cfloop from="1" to="#QUERIES.GetStep5Waiting.RecordCount#" index="i">  
				    
					<cfset StepID = QUERIES.GetStep5Waiting.ID[i]> 					                        
					<cfset EmpName =  QUERIES.GetStep5Waiting.Name[i]>  
                    
                    <cfset QUERIES.GetEmpInfo = baseQueries.funcGetEmpInfo(QUERIES.GetStep5Waiting.ID[i]) />
                    <cfset QUERIES.GetDepts = baseQueries.funcGetDepts(QUERIES.GetEmpInfo.DeptID) />
                    
					<cfset EmpID = QUERIES.GetEmpInfo.ID>
					<cfset Badge = QUERIES.GetEmpInfo.BadgeID>
					<cfset AccessLevelIDs = QUERIES.GetEmpInfo.BadgeAccessLevelID>
					<cfset BadgePos = QUERIES.GetEmpInfo.BadgePos>                   
					<cfset Dept = QUERIES.GetDepts.OrganizationDescription>
                    
                    <cfif QUERIES.GetEmpInfo.BadgeAccessLevelID eq '-- None --'>
                           
					    <cfset QUERIES.GetAccess = baseQueries.funcGetAccess( 0 ) />
					    
					<cfelse>
					
					    <cfset QUERIES.GetAccess = baseQueries.funcGetAccess( QUERIES.GetEmpInfo.BadgeAccessLevelID ) />
					    
					</cfif>
					
					<cfif QUERIES.GetEmpInfo.BadgeID NEQ "">
					   
					    <cfset QUERIES.GetAccessID = baseQueries.funcGetAccessID( QUERIES.GetEmpInfo.BadgeID ) />
					    <cfset AccessID = QUERIES.GetAccessID.EmpID>
					     
					<cfelse>
					
					    <cfset AccessID = "">
					     
					</cfif>                                                       
					
					
					<tr>
						<td>&nbsp;</td> 
						<td valign="top">#i#)</td> 
						<td>&nbsp;</td>  
						<td nowrap="nowrap" valign="top">
						#EmpName# (#Badge#)<BR />
						   #BadgePos#<BR />
						   #Dept#<BR />
						</td>
						<td>&nbsp;</td> 
						<td valign="top">
						<cfif QUERIES.GetAccess.recordcount GT 0>
						   	<cfset intY = 1>
						       <cfloop query="QUERIES.GetAccess">
						           #intY++#) #Descript#<BR />
						       </cfloop>
						   <cfelse>
						   	None
						   </cfif>
						</td> 
						<td>&nbsp;</td> 
						<td valign="top">
						<cfinput type="text" name="AccessID_#EmpID#_#StepID#" 
						error_message="The Access Control ID for 
                        '#EmpName#' must be numeric.  If there are no levels 
                        granted, and therefore an Access Control record is not 
                        necessary, please leave this field blank." 
                        size="6" value="#AccessID#">
						
						</td>
						<td>&nbsp;</td> 
						<td colspan="2" valign="top">
                            <cftextarea name="Comments_#EmpID#_#StepID#" 
                                style="width:96%" class="spellCheckMe" />
                        </td> 
					</tr>
					<tr>
					    <td>&nbsp;</td> 
					</tr>

				</cfloop>
	             
	             <tr>
	                 <td colspan="11" align="right">
	                 	<cfinput type="button" name="AccessLvl" value="Submit" >
	                 </td> 
	             </tr>
	         </table>
	        </cfform>
	          
	    <cfelse>
	    	<span class="error">At the present time, there are not any employees staged for entry to the Access Control system.</span>
	    </cfif>
	 	            
	</div>

    
<cfelse>

	<cfinclude template="../Denied.cfm">
    
</cfif>

    

    <!---HTML footer, closes html and body tags.  Any footer info goes here--->
    #BASE.htmlFooterNonSCF()#
    <!---HTML footer, closes html and body tags.  Any footer info goes here--->
</cfoutput>

